import { createRouter, createWebHashHistory } from "vue-router";
import Home from "../views/Home.vue";
import Router from "vue-router";
import Vue from "vue";
Vue.use(Router);
const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/gen",
    name: "gen",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/build/index.vue"),
  },

  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
];

export default new Router({
  mode: "history", // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes,
});
